package advice;

import org.apache.log4j.Logger;
import org.springframework.aop.MethodBeforeAdvice;

import java.lang.reflect.Method;
import java.util.Arrays;

public class BeforeAdvice implements MethodBeforeAdvice {
    //前置增强 实现接口

    //日志对象
    private static Logger logger =  Logger.getLogger(BeforeAdvice.class);



    @Override
    public void before(Method method, Object[] objects, Object o) throws Throwable {  //method方法，objects参数，o对象
        System.out.println("调用了"+o+"的"+method.getName()+"方法，方法的参数是："+ Arrays.toString(objects));
    }

}
